package  
{
	import net.flashpunk.FP;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.World;
	import net.flashpunk.utils.Input;
	import net.flashpunk.utils.Key;

	public class MainMenuWorld extends World 
	{
		[Embed(source = 'img/menu.png')]private const TITLE:Class;
				
		public function MainMenuWorld() 
		{
			addGraphic(new Image(TITLE));
			
			add(new TextMessage("Welcome to The Dreamatorium!", 290, 200));
			add(new TextMessage("A space that is reserved for virtual adventures...", 230, 225));
			add(new TextMessage("Pick up the costumes and reach the secret door!", 235, 330));
			
			add(new TextMessage("Arrow Keys ---> Move and Jump!", 280, 380));
			add(new TextMessage("Space Bar ---> Power! (only with a costume)", 280, 400));
			add(new TextMessage("A ---> Normal mode", 280, 420));
			add(new TextMessage("S ---> Inspector mode", 280, 440));
			add(new TextMessage("D ---> Batman mode", 280, 460));
			
			add(new TextMessage("Press Space Bar to begin!", 500, 600));
			
		}
		
		override public function update():void {
		
			if (Input.check(Key.SPACE))
			{
				playTheGame();
			}
		}
		
		private function playTheGame():void 
		{
			FP.world = new GameWorld();
			removeAll();
		}
		
		
		
	}

}